/* @(#)GSAfficheProcessor.java    V0.1
 *
 * Project: NEWGS
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   owen         2006-5-24
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
 *        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
 *        Haidian District, Beijing ,100081, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with HiTRUST.
 *
 * Warning:
 * =============================================================================
 * 
 */
package com.hitrust.gs.business;

import java.util.ArrayList;

import com.hitrust.gs.bean.GSAlignmentBean;
import com.hitrust.gs.bean.GSManufactureBean;
import com.hitrust.gs.bean.GSManufactureCategoryBean;
import com.hitrust.gs.bean.GSProviderBean;
import com.hitrust.gs.dao.GSBusAlignmentDAO;
import com.hitrust.gs.dao.GSManufactureCategoryDAO;
import com.hitrust.gs.dao.GSManufactureDAO;
import com.hitrust.gs.dao.GSProviderDAO;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseProcesser;
import com.hitrust.gs.util.exception.GSException;
import com.hitrust.gs.vo.GSManufactureVO;

import framework.core.ConstDefine;
import framework.core.DateUtil;

/**
 * 
 */
public class GSBusAlignmentProcessor implements GSBaseProcesser {
    /**
     * 增加发送任务
     * 
     * @param aGSBalanceFeeBean
     * @throws GSException
     */
    public static void addTask(GSAlignmentBean aGSAlignmentBean) throws GSException {
        GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
        if (tGSBusAlignmentDAO.add(aGSAlignmentBean) == false) {
            throw new GSException("增加任务失败!");
        }
    }
    /**
     * 查询发送任务
     * 
     * @param aGSBalanceFeeBean
     * @throws GSException
     */
    public static ArrayList searchTask() throws GSException {
        GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
        ArrayList taskList = tGSBusAlignmentDAO.searchTask();
        return taskList;
    }
    /**
     * 删除发送任务
     * 
     * @param aGSBalanceFeeBean
     * @throws GSException
     */
    public static boolean delTask(String id) throws GSException {
        GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
        boolean isDel = tGSBusAlignmentDAO.delTask(id);
        return isDel;
    }
    /**
     * 修改发送任务
     * 
     * @param aGSBalanceFeeBean
     * @throws GSException
     */
    public static boolean modifyTask(GSAlignmentBean aGSAlignmentBean,String responseCode) throws GSException {
        GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
        boolean isModify = tGSBusAlignmentDAO.modify(aGSAlignmentBean,responseCode);
        return isModify;
    }
    /**
     * 查询任务是否存在
     * 
     * @param aGSBalanceFeeBean
     * @throws GSException
     */
   public static ArrayList searchTaskIsExist(String actionName,String Remark) throws GSException {
       GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
       ArrayList isExist = tGSBusAlignmentDAO.searchTaskIsExist(actionName,Remark);
       return isExist;
   }
   /**
    * 删除发送任务
    * 
    * @param aGSBalanceFeeBean
    * @throws GSException
    */
   public static boolean delExistTask(String actionName,String remark) throws GSException {
       GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
       boolean isDel = tGSBusAlignmentDAO.delExistTask(actionName,remark);
       return isDel;
   }
   
   /**
    * 查询入库主表消息
    * 
    * @param aGSBalanceFeeBean
    * @throws GSException
    */
   public static ArrayList searchInHead(String inBillCode) throws GSException {
       GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
       ArrayList isExist = tGSBusAlignmentDAO.searchInHead(inBillCode);
       return isExist;
   }
   
   /**
    * 查询入库子表消息
    * 
    * @param aGSBalanceFeeBean
    * @throws GSException
    */
   public static ArrayList searchInSub(String inBillCode) throws GSException {
       GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
       ArrayList isExist = tGSBusAlignmentDAO.searchInSub(inBillCode);
       return isExist;
   }
   /**
   * 查询出库主表消息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static ArrayList searchOutHead(String outBillCode) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList isExist = tGSBusAlignmentDAO.searchOutHead(outBillCode);
      return isExist;
  }
  public static ArrayList searchOutHead(String startDate ,String endDate) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList isExist = tGSBusAlignmentDAO.searchOutHead(startDate,endDate);
      return isExist;
  }
  /**
   * 查询出库子表消息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static ArrayList searchOutSub(String outBillCode) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList isExist = tGSBusAlignmentDAO.searchOutSub(outBillCode);
      return isExist;
  }
  public static ArrayList searchOutSub(String startDate ,String endDate) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList isExist = tGSBusAlignmentDAO.searchOutSub(startDate,endDate);
      return isExist;
  }
  /**
   * 查询出库产品信息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static GSManufactureBean searchProduct(String aManufactureId) throws GSException {
      GSManufactureDAO tGSManufactureDAO = new GSManufactureDAO();
      GSManufactureBean tGSManufacture = null;
      tGSManufacture = tGSManufactureDAO.getManufacture(aManufactureId);
      return tGSManufacture;
  }
  
  /**
   * 查询入库产品信息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static GSManufactureBean searchInProduct(String aManufactureId) throws GSException {
      GSManufactureDAO tGSManufactureDAO = new GSManufactureDAO();
      GSManufactureBean tGSManufacture = null;
      tGSManufacture = tGSManufactureDAO.getInManufacture(aManufactureId);
      return tGSManufacture;
  }
  
  /**
   * 查询产品库存信息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static ArrayList searchProductCount(String productId,String whCode) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList tList = tGSBusAlignmentDAO.searchProductCount(productId,whCode);
      return tList;
  }
  /**
   * 查询仓库管理员信息
   * 
   * @param aGSBalanceFeeBean
   * @throws GSException
   */
  public static ArrayList searchWarehouseStaff(String productId,String whCode) throws GSException {
      GSBusAlignmentDAO tGSBusAlignmentDAO = new GSBusAlignmentDAO();
      ArrayList tList = tGSBusAlignmentDAO.searchWarehouseStaff(productId, whCode);
      return tList;
  }
  
  public static GSManufactureCategoryBean searchMaterialType(String id) throws GSException {
      GSManufactureCategoryDAO tGSManufactureCategoryDAO = new GSManufactureCategoryDAO();
      return tGSManufactureCategoryDAO.getCategory(id);
  }
  
  public static GSProviderBean searchProvider(String id) throws GSException {
      GSProviderDAO tGSProviderDAO = new GSProviderDAO(); 
      return tGSProviderDAO.queryProviderByShortNameOrId(id);
  }
  
  public static GSManufactureVO  searchManufacture(String id) throws GSException {
      GSManufactureDAO tGSManufactureDAO = new GSManufactureDAO(); 
      GSManufactureBean bean =  tGSManufactureDAO.getManufacture(id);
      GSManufactureVO vo = new GSManufactureVO();
      vo.setGs_concentricity_id(bean.getGs_concentricity());
      vo.setGs_manufacture_name(bean.getGs_manufacture_name());
      vo.setGs_manufacture_category_id(bean.getGs_manufacture_category_id());
      vo.setGs_manufacture_spec(bean.getGs_manufacture_spec());
      vo.setGs_manufacture_type(bean.getGs_manufacture_type());
      vo.setGs_quant_unit(bean.getGs_quant_unit());
      vo.setGs_manufacture_brand(bean.getGs_manufacture_brand());
      vo.setGs_make_area(bean.getGs_make_area());
      vo.setGs_planprice(""+bean.getPlan_price());
      vo.setGs_manufacturer_name(bean.getGs_manufacturer_name());
      vo.setGs_quality_assure_period(bean.getGs_quality_assure_period());
      vo.setGs_manufacture_id(bean.getGs_manufacture_id());
      return vo;
      

  }
  
}
